package com.example.myapplication

import com.example.myapplication.clean_craftsmanship.Customer
import com.example.myapplication.clean_craftsmanship.VideoType
import org.junit.Test

import org.junit.Assert.*

class CustomerTest {

    val customer = Customer()
    fun Customer.assertFeeAndPoints(fee: Double, points: Int) {
        assertEquals(fee, this.fee,0.001)
        assertEquals(points, this.points)
    }

    @Test
    fun regularMovie_OneDay() {
        customer.addRental(VideoType.REGULAR, 1)
        println(customer.fee)
        println(customer.points)
    }

    @Test
    fun regularMovie_TwoDay() {
        customer.addRental(VideoType.REGULAR, 2)
        customer.  assertFeeAndPoints(1.5, 1)
    }


    @Test
    fun regularMovie_SecondDayAndThirdDayFree() {
        customer.addRental(VideoType.REGULAR, 3)
        customer. assertFeeAndPoints(1.5, 1)
    }

    @Test
    fun childrenMove_OneDay() {
        customer.addRental(VideoType.CHILDREN, 1)
        customer.   assertFeeAndPoints(1.0, 1)
    }
}
